/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-04-27
 * Time: 11:20
 */

class Animal {

}

class Student extends Animal{

}

class Duck extends Animal{

}

class Sleep<T> {
    private T name;


    public void setName(T name) {
        this.name = name;
    }

    public T getName() {
        return this.name;
    }
}
public class TestDemo {
    public static void fun(Sleep<? extends Animal> sleep) {
        Animal animal = sleep.getName();

    }
    public static void main(String[] args) {
        Sleep<Animal> sleep1 = new Sleep<>();
        Sleep<Student> sleep2 = new Sleep<>();
        Sleep<Duck> sleep3 = new Sleep<>();
        fun(sleep1);
        fun(sleep2);
    }
}